package com.example.zhu.mapper;

import com.example.zhu.dto.ManageDTO;
import com.example.zhu.entity.Manage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface ManageMapper {

    void insert(ManageDTO manageDTO);

    @Select("select * from manage")
    List<Manage> selectAll();

    @Select("select * from manage where id = #{id}")
    @Options(useGeneratedKeys = true,keyProperty = "id",keyColumn = "id")
    Manage selectEditInfo(Integer id);

    @Update("update manage set take_key = #{takeKey} , send_key = #{sendKey} where id = #{id};")
    void update(ManageDTO manageDTO);
}
